FROM centos:7

LABEL maintainer="llww" \
    provider="llww."


# Do not use alias cp
RUN \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && rm -rf /etc/yum.repos.d/* \
    && curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo \

#    && yum update -y \
    && yum makecache \
    ## 安装应用
    && yum install -y  passwd \
    && yum install -y  sudo \
    && yum install -y  tree \
    && yum install -y  telnet \
    && yum install -y  lsof \
    && yum install -y  openssh-server \
    && yum install -y  bind-utils \
    && yum install -y  wget \
    && yum install -y  which \
    && yum install nc -y \
    && yum install nmap -y \
#    && yum install -y  maven \
    && yum install -y  vim \
    && yum install -y  java-11-openjdk-devel.x86_64 \
#    && yum install -y  git \
    && yum install -y  net-tools \

    ## 别名
    && echo "alias cp='cp -i'" >> /etc/bashrc \
    && echo "alias kill9='kill -9'" >> /etc/bashrc \
    && echo "alias egrep='egrep --color=auto'" >> /etc/bashrc \
    && echo "alias fgrep='fgrep --color=auto'" >> /etc/bashrc \
    && echo "alias grep='grep --color=auto'" >> /etc/bashrc \
    && echo "alias l.='ls -d .* --color=auto'" >> /etc/bashrc \
    && echo "alias ll='ls -l --color=auto'" >> /etc/bashrc \
    && echo "alias ls='ls --color=auto'" >> /etc/bashrc \
    && echo "alias mv='mv -i'" >> /etc/bashrc \
    && echo "alias vi='vim'" >> /etc/bashrc \
    && echo "alias rm='rm -i'" >> /etc/bashrc \
    && echo "alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'" >> /etc/bashrc \
    && echo "alias xzegrep='xzegrep --color=auto'" >> /etc/bashrc \
    && echo "alias xzfgrep='xzfgrep --color=auto'" >> /etc/bashrc \
    && echo "alias xzgrep='xzgrep --color=auto'" >> /etc/bashrc \
    && echo "alias zegrep='zegrep --color=auto'" >> /etc/bashrc \
    && echo "alias zfgrep='zfgrep --color=auto'" >> /etc/bashrc \
    && echo "alias zgrep='zgrep --color=auto'" >> /etc/bashrc \
    && echo "alias pub='ssh-keygen;echo 公钥为;cat ~/.ssh/id_rsa.pub '" >> /etc/bashrc \


    ## 设置root密码
    && echo "root" | passwd --stdin root \
    && groupadd -r llww && useradd -g llww llww \
    && echo "llww" | passwd --stdin llww \

    ## motd
    && echo "pub 创建并获取公钥" >> /etc/motd \

    ## 最终
    && echo "succssful"

    ENV JAVA_HOME='/etc/alternatives/java_sdk_11_openjdk'
    ENV PATH="${JAVA_HOME}/bin:${PATH}"



EXPOSE 22
CMD ["/usr/sbin/init"]


